//package com.tjresearch.service;
//
//import java.util.Date;
//
//import org.springframework.amqp.core.AmqpTemplate;
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.messaging.handler.annotation.Payload;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Service;
//
//@Service
//@RabbitListener(queues="helloQueue")
//public class RabbitMqService {
//	@Autowired
//	private AmqpTemplate rabbitTemplate;
//	 @Scheduled(fixedDelay=3000)
//	public void send() {
//		String sendMsg = "发送的时间是 " + new Date();
//		System.out.println("发送消息");
//		this.rabbitTemplate.convertAndSend("helloQueue", sendMsg);
//	}
//	 
//	 //接收到消息处理.
//
//	    @RabbitHandler
//	    public void onMessage(@Payload String helloQueue){
//	       System.out.println("我是接收端，接收的时间是 "+new Date() + ": " + helloQueue);
//
//	    }
//
//}
